import {getPngSrc} from "/src/utils/baseTool";
import {Cartesian3} from 'cesium'

export function cleanEntity() {
    viewer.entities.removeAll()
}

export function cleanEntityById(id) {
    viewer.entities.removeById(id)
}

export function addEntity(drawPoint, deviceCode, deviceId, imageName) {
    viewer.entities.add({
        position: Cartesian3.fromDegrees(drawPoint.x, drawPoint.y, drawPoint.z),
        billboard: {
            image: getPngSrc(imageName),
            width: 30,
            height: 40
        },
        name: deviceCode,
        id: deviceId,
    })
}
